﻿package{
	
	
	import flash.display.Sprite;
	import flash.display.MovieClip;
	
	import flash.events.MouseEvent;
	import flash.events.Event;
	
	import flash.net.navigateToURL;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
	

	public class Menu_GetClickr extends Sprite{
		
		
		public function Menu_GetClickr(){
			
			
			addEventListener(Event.ADDED_TO_STAGE, Init);
			
		}
		
		private function Init(e:Event) {
			removeEventListener(Event.ADDED_TO_STAGE, Init);
			
			Close.addEventListener(MouseEvent.CLICK, onClickClose);
			GetClickr.addEventListener(MouseEvent.CLICK, onClickGetClickr);
		}
		
		
		private function onClickClose(e:MouseEvent) {
			trace(this, ": onClickClose");
			dispatchEvent(new NavigationEvent(NavigationEvent.CLOSE, "getClickr", this));
			
		}
		
		private function onClickGetClickr(e:MouseEvent):void {
			trace(this, ": onClickGetClickr");
			
			var url:String = "http://www.clickr.kr/buy";
            
            var request:URLRequest = new URLRequest(url);
            
            try {            
                navigateToURL(request);
            }catch (e:Error) {
                // handle error here
            }
			
			//dispatchEvent(new NavigationEvent(NavigationEvent.CLOSE, "getClickr", this));
			
			
		}
		
	}
	
	
}